

#include "QueryTree.h"
#include <iostream>
using namespace std;

	TNode QueryTree::rootNode;

	TNode QueryTree::createNode(TYPE type, TNode parent) {
		TNode node;
		node.create(type, -1);
		node.setParent(parent);
		return node;
	}

	void QueryTree::setParentChild(TNode* parent, TNode child) {
		(*parent).setChild(child);
		child.setParent(*parent);
	}

	vector<TNode> QueryTree::getChildren(TNode node) {
		return node.getChild();
	}

	TNode QueryTree::getParent(TNode node) {
		TNode* parent = node.getParent();
		return *parent;
	}

	void QueryTree::setRoot(TNode root) {
		rootNode = root;
	}

	TNode QueryTree::getRoot() {
		return rootNode;
	}